Leadtools.Dicom.Common

Macros Property

Show in webframe
Example 





Gets or sets the macros.
Syntax
'Declaration
 
Public Property Macros As Dictionary(Of String,MacroSubsitutionDelegate(Of T))
'Usage
 
Dim instance As MacroProcessor(Of T)
Dim value As Dictionary(Of String,MacroSubsitutionDelegate(Of T))
 
instance.Macros = value
 
value = instance.Macros

            

            

Property Value

The list of macros and delegates to be called to process the macro.
Example
Copy Code  
Imports Leadtools.Dicom.Common.Anonymization

Public Sub MacroProcessorSample()
   Dim processor As New MacroProcessor(Of Object)()

   '
   ' add two macros to the macro processor
   '
   processor.Macros.Add("current_date", New MacroSubsitutionDelegate(Of Object)(AddressOf CurrentDateMacro))
   processor.Macros.Add("current_time", New MacroSubsitutionDelegate(Of Object)(AddressOf CurrentTimeMacro))

   '
   ' Process a macro string
   '
   Console.WriteLine(processor.Process(processor, "${current_date} ==> ${current_time}"))
End Sub

Private Function CurrentDateMacro(ByVal userData As Object, ByVal name As String, ByVal ParamArray parameters As Object()) As String
   Return DateTime.Now.ToShortDateString()
End Function

Private Function CurrentTimeMacro(ByVal userData As Object, ByVal name As String, ByVal ParamArray parameters As Object()) As String
   Return DateTime.Now.ToShortTimeString()
End Function
Requirements

Target Platforms

See Also

Reference

MacroProcessor<T> Class
MacroProcessor<T> Members

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.

Leadtools.Dicom.Common requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features